#include "stm32f10x.h" // Device header
#include "delay.h"
#include "led.h"
#include "key.h"

int main(void)
{

	Init_LED_GPIO();
	Init_GPIO_KEY();

	while (1)
	{

		if (READ_KEY1() == 0)
		{
			Delay_ms(10);
			if (READ_KEY1() == 0)
			{
				LED_ALL_OFF();
			}
		}


		if (READ_KEY2() == 0)
		{
			Delay_ms(10);
			if (READ_KEY2() == 0)
			{
				LED1_ON();
			}
		}

		if (READ_KEY3() == 0)
		{
			Delay_ms(10);
			if (READ_KEY3() == 0)
			{
				LED3_ON();
			}
		}

		if (READ_KEY4() == 0)
		{
			Delay_ms(10);
			if (READ_KEY4() == 0)
			{
				LED2_ON();
			}
		}
	}
}
